UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FjeuJUOyPqW2KMgBylbzjFSe/jE9jvbMEqmcD5c3hwY=' 
WHERE 
  key_id = '349ddc7db27990538262c5edb0b8715a51d055912b47824887ab51acb4018937' 
  AND (
    token = 'FjeuJUOyPqW2KMgBylbzjFSe/jE9jvbMEqmcD5c3hwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023