UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7LgxDfSWIKtVBGkUlVmeysVHmuY5SajjJ5UVXBi+m6o='
WHERE
key_id = 'c6ba19a062d3bfc383619f34e8d3461a39fd4fc45c4f63a7a5668b3d0edb23c7'
AND (
token = '7LgxDfSWIKtVBGkUlVmeysVHmuY5SajjJ5UVXBi+m6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)