UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uj3Ahnk/HEgwWncXR4AehviXV9hb+HgkW5Q/nbGwO6E=' 
WHERE 
  key_id = 'ddd00e921da3ca774cbf9d7a680b61e46f1326b4d43f217f21ccf2c07e98284c' 
  AND (
    token = 'Uj3Ahnk/HEgwWncXR4AehviXV9hb+HgkW5Q/nbGwO6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055