UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kZC6UU0CvJHra2F3YtQOazDnp6/tmLtsIlP7OLc+MI4='
WHERE
key_id = '3be9023c3b906de6606e59afc2a7dd6bc375289d7c6ff67cc44b1d4ae5cea9c0'
AND (
token = 'kZC6UU0CvJHra2F3YtQOazDnp6/tmLtsIlP7OLc+MI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)