UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dDFHr6fjgI00m/Jv+8EYKlS/TkJabJ5LwpjDWywZVWo=' 
WHERE 
  key_id = '4b3ea0846748d62600eb997802a4305ff9a7d1c9aa923165797c283921c35914' 
  AND (
    token = 'dDFHr6fjgI00m/Jv+8EYKlS/TkJabJ5LwpjDWywZVWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020