UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yWcTvosz/1lzq6F9ovCCw3vDuFO5SSH6WRCUxh8Gr20=' 
WHERE 
  key_id = '6483556c1866df34fa3f7ef83b571f095fd4ce3a981d01fb0c7b655114dd5740' 
  AND (
    token = 'yWcTvosz/1lzq6F9ovCCw3vDuFO5SSH6WRCUxh8Gr20=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018