UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IgLYmTDqV0ei5chY/RYAuvaexYcC9IINWmBwp7GXEq0='
WHERE
key_id = '72a46eec619ec8e48c195977cc4e49705d34157a450f0a3894e6cb6641d50b73'
AND (
token = 'IgLYmTDqV0ei5chY/RYAuvaexYcC9IINWmBwp7GXEq0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)