UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7i8QGlVKuyuxg4dzFx0B45U4HNTQ3eWA1mi55MwtYkI=' 
WHERE 
  key_id = '578657970ffbfa5516d9d9cb78b5955db7ab03944b60c3fb16f8cd52cfe71b47' 
  AND (
    token = '7i8QGlVKuyuxg4dzFx0B45U4HNTQ3eWA1mi55MwtYkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043