UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2vANC+0A9/GPpGTOS4TQdeEkVnTzF4HeSdSx7L4uUHg=' 
WHERE 
  key_id = 'f70afeeb875d89d963e4aa31e242b90520ee8b19171227a274b8c99bdd2c17a1' 
  AND (
    token = '2vANC+0A9/GPpGTOS4TQdeEkVnTzF4HeSdSx7L4uUHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054