UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Rhxpg/mvjU9HQRDZBduNu7o8ILIi9wtpgeqP7nef1g=' 
WHERE 
  key_id = '5b01693dd5d0617567fdaefcd563da8d071c5d21856ddeacb4af325a0e8f8cbf' 
  AND (
    token = '2Rhxpg/mvjU9HQRDZBduNu7o8ILIi9wtpgeqP7nef1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029