UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k1StacehmTxyHcpxysnqP5RSMYFW8HG9AFiuwNFtQL8='
WHERE
key_id = '05631ac038fad8e6a14fedc3defe5a8585b08aced508e81b220d3c0928c8b67f'
AND (
token = 'k1StacehmTxyHcpxysnqP5RSMYFW8HG9AFiuwNFtQL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)