UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Ly7oulWjNjl8iE+s4dlzC5ZzFc8SEOEgNBXYSgd8bo='
WHERE
key_id = '92baf95ebf29c4362ea30d4228a68028889ffc78b0b5702dc7c75ff520984590'
AND (
token = '0Ly7oulWjNjl8iE+s4dlzC5ZzFc8SEOEgNBXYSgd8bo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)