UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm0DH6ToXXezDckhek0atxgWyHrLW9aIHGoWxbHnAVQ8=' 
WHERE 
  key_id = 'a229141d18572e742e3291cd7f71abd3b2958e3cd88c72fdc852a9a4b1fbae86' 
  AND (
    token = 'm0DH6ToXXezDckhek0atxgWyHrLW9aIHGoWxbHnAVQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030