UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nxbXVlvM2XVzNK1PskUOKe1lwjwOmGEUaoHU01/t7X0=' 
WHERE 
  key_id = '44fd6f4e505a82d7430f0d41772d556785df4c4e46a944f213df8199b2614234' 
  AND (
    token = 'nxbXVlvM2XVzNK1PskUOKe1lwjwOmGEUaoHU01/t7X0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021