UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wZ/+nKaFSllmHrPxb2HX4eMkczKQYTAma+ZBHgSx91o='
WHERE
key_id = '4feffdb45150234570714098b9825f2547ed4189bb5cd53abe7785c40f34ce05'
AND (
token = 'wZ/+nKaFSllmHrPxb2HX4eMkczKQYTAma+ZBHgSx91o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)