UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'biNuRpIMjzyP3G/izmaPqTlsj25Z4IFvAlwoUgBhyLc=' 
WHERE 
  key_id = '7d6328b7c454e2d064dc195c1b44c2f1ef74b96f069e38c7b02d1e41fe7a2eae' 
  AND (
    token = 'biNuRpIMjzyP3G/izmaPqTlsj25Z4IFvAlwoUgBhyLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027