UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aji46aDvwmCdBO5fAurlC4Tl+8xQZ5JQDrNtEXV9ZqA='
WHERE
key_id = '866ee26e1e4792709065c7d102c36d30492a1159790c5f01ce7cd2c0109d5bfc'
AND (
token = 'aji46aDvwmCdBO5fAurlC4Tl+8xQZ5JQDrNtEXV9ZqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)