UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '85BlA1EKdjfCPSdb8uLvfchRfXn2s6AVqUJyXDgbMMI='
WHERE
key_id = '3314d03c0a63a27a4ea1948548159c0364f3d1b4f809eded7ae50d4a1321438d'
AND (
token = '85BlA1EKdjfCPSdb8uLvfchRfXn2s6AVqUJyXDgbMMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)