UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QDrRPpQMDr2NO/IqfvLEgebYQVBwoG7t1N9Gmdn5Am0=' 
WHERE 
  key_id = '601496ae6205c486eadad0bf9ffd31f9f2944361382c8d6218214775ac336299' 
  AND (
    token = 'QDrRPpQMDr2NO/IqfvLEgebYQVBwoG7t1N9Gmdn5Am0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020