UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SiTV3dackHGgczR323LLkYLUeBB9eW/86vqdI4UA1xc='
WHERE
key_id = '3a9370037a83173a3ca2d94265f754bd2c03f2a2d5a30143668af845d6da2c8a'
AND (
token = 'SiTV3dackHGgczR323LLkYLUeBB9eW/86vqdI4UA1xc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)