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