UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIDSHZzODMQXHbbmcoQ//BfcBu3h7x9XeHSfJmqvd8c=' 
WHERE 
  key_id = '322765c446f789f08b7838bae865208115d1500f81a7ce4db231eb0233d173af' 
  AND (
    token = 'EIDSHZzODMQXHbbmcoQ//BfcBu3h7x9XeHSfJmqvd8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030