UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XQHtFjvtY/4BGVxsMhtJUpYjk1LQCr6p8J3mFun2aAc=' 
WHERE 
  key_id = 'efb1a120c0dc4526203a81d1dcc40c80d4e430c721138a4810db179f2c5e1c91' 
  AND (
    token = 'XQHtFjvtY/4BGVxsMhtJUpYjk1LQCr6p8J3mFun2aAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024