UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9HECl/kJ5wBigaZbnNDGdFkwWgk4bSKtXF0MHIDL0DA='
WHERE
key_id = '473beb5cd7125c1a4e938cad8b6292d9e65ff7475a29778af7207731506a8394'
AND (
token = '9HECl/kJ5wBigaZbnNDGdFkwWgk4bSKtXF0MHIDL0DA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)