UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EnPaskWY462exWJwdtg2Wl2bUWaE01ExTlTUFDStAqM=' 
WHERE 
  key_id = '2b1b9eb3abcb310cd350365e7d4e93c8d388fc9acedb493ed1541738cec0ff57' 
  AND (
    token = 'EnPaskWY462exWJwdtg2Wl2bUWaE01ExTlTUFDStAqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052