UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tRlPyzEbjE3TvrMmW88Gto3xnfdBD/tgzKi3yHCY0tg=' 
WHERE 
  key_id = 'feb9543dd867352ae3453303a6cd4e68a9c754b81b1cc621f5e5759498f7ec1e' 
  AND (
    token = 'tRlPyzEbjE3TvrMmW88Gto3xnfdBD/tgzKi3yHCY0tg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034