UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OnEs9z3sWiMqTbCRLltp0P3vABt5qAqhc6OD6dHRzjQ=' 
WHERE 
  key_id = 'b39b5d9b8a4b533f939b5e9b10f6861f1ca0e7f7a47c2dc45cfe7283e9c21525' 
  AND (
    token = 'OnEs9z3sWiMqTbCRLltp0P3vABt5qAqhc6OD6dHRzjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022