UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ql7vFcZTRFVX8cDsVpRE2S0IJ+IMErceFW3JhoQzOHU=' 
WHERE 
  key_id = '75f88a40dfd5031546025a081ed3bd3de29891ccf2d47e0d0d9b8de238ddaffc' 
  AND (
    token = 'ql7vFcZTRFVX8cDsVpRE2S0IJ+IMErceFW3JhoQzOHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042