UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5sP7CHeSQ+SweK0bBckjLXTmvKB4ZnwBnyzId6ue200='
WHERE
key_id = '15d2069e7706fb00f158664fc6b823d97873fd24e4ba42d7d4fc5084655bc685'
AND (
token = '5sP7CHeSQ+SweK0bBckjLXTmvKB4ZnwBnyzId6ue200='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)