UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5GfD3Lth5Tsfs2ZH/MQa+gVpfPDuRqhR4dLi/6xi90M='
WHERE
key_id = '695eceef870bb6a8c92ae4fc189ab98f2f71a0b9c5d90fd4bac67fdbf5fe5912'
AND (
token = '5GfD3Lth5Tsfs2ZH/MQa+gVpfPDuRqhR4dLi/6xi90M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)