UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WZ1Fauy/ZPHC1tOzsVsHQTnmAmShLjb1WZpE8aZiPjw='
WHERE
key_id = '67249c71c06aebb0cac403f2be4cad2f002c6fd3d1f883b010874b5488d63f58'
AND (
token = 'WZ1Fauy/ZPHC1tOzsVsHQTnmAmShLjb1WZpE8aZiPjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)