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

Query time 0.00042