UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TXGR2Qq/HME+yr3jz2LzvPlaGGbeqz9ON8tsgBaA5vI=' 
WHERE 
  key_id = '6cd583719663074dfdbf3cb3e5a00a666762f34ac7c257b23f322cf6c5594154' 
  AND (
    token = 'TXGR2Qq/HME+yr3jz2LzvPlaGGbeqz9ON8tsgBaA5vI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019