UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LvvEvpyuFYvZayPMY7FuiigOTKkafSj7OgIJil9VPus=' 
WHERE 
  key_id = 'effec25a11047065d48adb303d1d02212064dde8723536fe5d464fd191827f2d' 
  AND (
    token = 'LvvEvpyuFYvZayPMY7FuiigOTKkafSj7OgIJil9VPus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033