UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SYuVCEBMsLWt3pv08e5+lCjeSOsVwEQIvsqw1GPFXN8='
WHERE
key_id = 'fcced1dd196e4e44365944c72ca93b20997126b387f6833a4e0adddb3a110995'
AND (
token = 'SYuVCEBMsLWt3pv08e5+lCjeSOsVwEQIvsqw1GPFXN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)