UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nnn3epvfIbKusrXTFWwUEnYx2yhj0KDnS6T+zbajaLw=' 
WHERE 
  key_id = 'd53d41dc167c560441bccd4e0691e294172a3cc8e43a0a73c4c1cc025e3ed93c' 
  AND (
    token = 'nnn3epvfIbKusrXTFWwUEnYx2yhj0KDnS6T+zbajaLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033