UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+QuXtDOP+aYkO9D5MD1r+zUY8dfxt83sZwNHW+YdeJE='
WHERE
key_id = 'ec15fccdb159cb5003f3dbf4d4db7c58e43afa462816a4631ead435c1ef6870e'
AND (
token = '+QuXtDOP+aYkO9D5MD1r+zUY8dfxt83sZwNHW+YdeJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)