UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x9rg242vpCKHETlOgNX5LTtyVO8F9IFq+nFJ1WVT5TI=' 
WHERE 
  key_id = '282916677ad7f95ce20abcba742a5aacc63a20a20c7dc36a3ba760b51a15edfb' 
  AND (
    token = 'x9rg242vpCKHETlOgNX5LTtyVO8F9IFq+nFJ1WVT5TI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018