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

Query time 0.00030