UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'suLQ8fVmmK0HPPy/IrGJBhwzAbsCbPM2aOjWZx1ZyZs=' 
WHERE 
  key_id = '41ed282603312890f710ebc7ddcd601ef5b90ab4938ac6fd275e4040784e1322' 
  AND (
    token = 'suLQ8fVmmK0HPPy/IrGJBhwzAbsCbPM2aOjWZx1ZyZs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036