UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MfwACIMqN5xOq4dCVZhRJ/3vY3GquW+MIbSSI9FvHWs=' 
WHERE 
  key_id = '0aa7f018a566fe28d06fd165a20f5ab07fc18fe6bdb53c82c06840a96be23d5d' 
  AND (
    token = 'MfwACIMqN5xOq4dCVZhRJ/3vY3GquW+MIbSSI9FvHWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032