UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pi+2oEgO9Nvx5ZsDOyadqnAH+XyliaQK8hQe7f2ifEU='
WHERE
key_id = 'e50521a692d2f3b8b65bc1cbe12afa644a261f68ab2794c82a85feb6ba41680c'
AND (
token = 'pi+2oEgO9Nvx5ZsDOyadqnAH+XyliaQK8hQe7f2ifEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)