UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ZHAC0m1sXNd+4mmc4UbvpRvVMPbQcYNrpkGsOlY5Lg='
WHERE
key_id = '7effd5f35bb59d84821426b9bf9f049627eb6c6fc12cb0e315a8dd46062e869d'
AND (
token = '+ZHAC0m1sXNd+4mmc4UbvpRvVMPbQcYNrpkGsOlY5Lg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)