UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cAeKcmFtftBobp9cANY5AsGsE//9pTZ92KZMoa+Dnpo=' 
WHERE 
  key_id = 'dfe28fc351be97b39cb76c608b7fd21224f34c1d0dd87fb94cd2b8666b53104e' 
  AND (
    token = 'cAeKcmFtftBobp9cANY5AsGsE//9pTZ92KZMoa+Dnpo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031