UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7p8bg+e5YvOSgYl05zryZhcqDc+NUQ9DlWEQRenMA0s='
WHERE
key_id = 'aa2df4bbf2b05fae7d75237c990818d3ffbbdd535737423ba7045fc5ba40f89f'
AND (
token = '7p8bg+e5YvOSgYl05zryZhcqDc+NUQ9DlWEQRenMA0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)