UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xy+ICnTHWbylhKFewhO5tb5Zr8kK4KcOxzlXVdW3Rzg=' 
WHERE 
  key_id = '9817eff8667917000e75fd8a72c1d5d9d8ce383a1c4fb1811d447d0f8143f8a8' 
  AND (
    token = 'Xy+ICnTHWbylhKFewhO5tb5Zr8kK4KcOxzlXVdW3Rzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033