UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6rV6DqIZX2o90gcgEt38ixDnjfwV5GFp8h2vegZdqUI='
WHERE
key_id = 'db3c964085409b5427b0a4752549d4c7350a79239967666478dc98f3239e9e6d'
AND (
token = '6rV6DqIZX2o90gcgEt38ixDnjfwV5GFp8h2vegZdqUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)