UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qzENpGUg5nKvV0kifmx/44JqilxBXWvifDGh4Hu5RQE='
WHERE
key_id = 'a4822fb9aec540d23b7a6b0f2f96e746c7cd348595d75cc961e940bd70610032'
AND (
token = 'qzENpGUg5nKvV0kifmx/44JqilxBXWvifDGh4Hu5RQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)