UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KLdkI67A2zYLu3O4ZiuXSrVpzZLFqc8j34VFNrlPxH8='
WHERE
key_id = '9cf02c7d69b04e4935b1c2a0dca91c5dc2461216e4cd20f83e51f833c7756c78'
AND (
token = 'KLdkI67A2zYLu3O4ZiuXSrVpzZLFqc8j34VFNrlPxH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)