UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x6DPNyHlRASybdBcT51GpL9io5xgSnR6M+fO/5IeF3U=' 
WHERE 
  key_id = 'f2f7e65c2de7959fe6cc23ad5e5f8310239b6ea2a822593761d2b7e2a6f055be' 
  AND (
    token = 'x6DPNyHlRASybdBcT51GpL9io5xgSnR6M+fO/5IeF3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040