UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DEC/56V/fnI+5WOHIiusaY00J/R2pVVv1Zc6Md1yGTA=' 
WHERE 
  key_id = '0b2dd2a25b68aff08422250b68fc2c5fd16af555261d4fea20e44778c413164f' 
  AND (
    token = 'DEC/56V/fnI+5WOHIiusaY00J/R2pVVv1Zc6Md1yGTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021