UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Dv9BE+UG4XVtcDbu/CrSqMAR6ab710GxLsIy/itO6A=' 
WHERE 
  key_id = 'c5332ae2b978d57aaba9e951c898a310f4c921b07d4a0fd4a0efe8dea65bf5a0' 
  AND (
    token = '0Dv9BE+UG4XVtcDbu/CrSqMAR6ab710GxLsIy/itO6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041