UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sDRsyVEpMbkz6L2eWhhCW2sPyp/Bfud7o8Jnu484Ops=' 
WHERE 
  key_id = '83edd33dc9a8677c49ce18b1aab19cfacdd9408be7d2eabee6bf2e9dab0680d2' 
  AND (
    token = 'sDRsyVEpMbkz6L2eWhhCW2sPyp/Bfud7o8Jnu484Ops=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036