UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bCxf6rHWiryk+tb5F+sTeG3PBB7Knmfqh96lurF7BwQ=' 
WHERE 
  key_id = '1d803f76d8f3b04b316f606a4fcfedd9134459bc48a81d320a713ea4bc3e1ccb' 
  AND (
    token = 'bCxf6rHWiryk+tb5F+sTeG3PBB7Knmfqh96lurF7BwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00075