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

Query time 0.00036