UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZiJ/wOQ/YZ9NYZXPhSr3n9x/rQ/cBAXkcRUJ8FtdR80=' 
WHERE 
  key_id = '249d32338581eadbfd973ee73a792041ff699625b319da39534059a5ad2af5d2' 
  AND (
    token = 'ZiJ/wOQ/YZ9NYZXPhSr3n9x/rQ/cBAXkcRUJ8FtdR80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019