UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1uytiLiLEm5QU/3IhZ6mExB/iOqV4d3ny2XvI/nvmOk='
WHERE
key_id = '995293977f93057b6c354eee5377c3ae352d3fe1d04eccfd39dafb6b21a8d2ce'
AND (
token = '1uytiLiLEm5QU/3IhZ6mExB/iOqV4d3ny2XvI/nvmOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)